#ifndef SERIALSELECTDIALOG_H
#define SERIALSELECTDIALOG_H

#include <QDialog>
#include <QSerialPortInfo>
#include <QSerialPort>
#include <QStringListModel>
#include <QDebug>
#include <QListView>
#include <optional>

namespace Ui {
class SerialSelectDialog;
}

class SerialSelectDialog : public QDialog
{
    Q_OBJECT

public:
    explicit SerialSelectDialog(QWidget* parent = nullptr);
    ~SerialSelectDialog();

    std::optional<QString> getSelectSerialPort();

private slots:
    void on_pushButton_clicked();

    void on_buttonBox_accepted();

    void on_buttonBox_rejected();

private:
    Ui::SerialSelectDialog* ui;
    QListView* serialPortListView;
    QPushButton* refreshButton;
    QStringListModel* model;
    QString selectSerialPort;
};

#endif   // SERIALSELECTDIALOG_H
